package com.pms.system.service.impl;

import java.util.List;
import com.pms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pms.system.mapper.PmsClientTypeMapper;
import com.pms.system.domain.PmsClientType;
import com.pms.system.service.IPmsClientTypeService;

/**
 * 客户类型Service业务层处理
 * 
 * @author 达瓦里氏
 * @date 2023-03-04
 */
@Service
public class PmsClientTypeServiceImpl implements IPmsClientTypeService 
{
    @Autowired
    private PmsClientTypeMapper pmsClientTypeMapper;

    /**
     * 查询客户类型
     * 
     * @param id 客户类型主键
     * @return 客户类型
     */
    @Override
    public PmsClientType selectPmsClientTypeById(Long id)
    {
        return pmsClientTypeMapper.selectPmsClientTypeById(id);
    }

    /**
     * 查询客户类型列表
     * 
     * @param pmsClientType 客户类型
     * @return 客户类型
     */
    @Override
    public List<PmsClientType> selectPmsClientTypeList(PmsClientType pmsClientType)
    {
        return pmsClientTypeMapper.selectPmsClientTypeList(pmsClientType);
    }

    /**
     * 新增客户类型
     * 
     * @param pmsClientType 客户类型
     * @return 结果
     */
    @Override
    public int insertPmsClientType(PmsClientType pmsClientType)
    {
        pmsClientType.setCreateTime(DateUtils.getNowDate());
        return pmsClientTypeMapper.insertPmsClientType(pmsClientType);
    }

    /**
     * 修改客户类型
     * 
     * @param pmsClientType 客户类型
     * @return 结果
     */
    @Override
    public int updatePmsClientType(PmsClientType pmsClientType)
    {
        pmsClientType.setUpdateTime(DateUtils.getNowDate());
        return pmsClientTypeMapper.updatePmsClientType(pmsClientType);
    }

    /**
     * 批量删除客户类型
     * 
     * @param ids 需要删除的客户类型主键
     * @return 结果
     */
    @Override
    public int deletePmsClientTypeByIds(Long[] ids)
    {
        return pmsClientTypeMapper.deletePmsClientTypeByIds(ids);
    }

    /**
     * 删除客户类型信息
     * 
     * @param id 客户类型主键
     * @return 结果
     */
    @Override
    public int deletePmsClientTypeById(Long id)
    {
        return pmsClientTypeMapper.deletePmsClientTypeById(id);
    }
}
